﻿@model blacksoft.Models.Persona

@{
    ViewBag.Title = "Edit";
}

@using blacksoft.Models

@{
    Layout = "~/Views/Shared/_LayoutCompras.cshtml";
}


<div class="block big">
    <div class="titlebar">
        <h3>Modificar Proveedor</h3>
    </div>
    <div class="block_cont">
        <h3>Información del Proveedor</h3>
        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()

            <div class="form">
                @Html.ValidationSummary(true)
                @Html.HiddenFor(model => model.IDPersona)
                @Html.HiddenFor(model => model.Estado)


                <div class="form_row">
                    @Html.LabelFor(model => model.RazonSocial, new { @class = "control-label col-md-2" })
                    @Html.TextBoxFor(model => model.RazonSocial, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.RazonSocial)
                    @Html.ValidationMessageFor(model => model.RazonSocial)
                </div>

                <div class="form_row">
                    @Html.LabelFor(model => model.RUC, new { @class = "control-label col-md-2" })
                    @Html.TextBoxFor(model => model.RUC, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.RUC)
                    @Html.ValidationMessageFor(model => model.RUC)
                </div>

                <div class="form_row">
                    @Html.LabelFor(model => model.Direccion, new { @class = "control-label col-md-2" })
                    @Html.TextBoxFor(model => model.Direccion, new { @class = "text-box single-line", @readonly = "readonly", @disabled = "disabled" })
                    @Html.HiddenFor(model => model.Direccion)
                    @Html.ValidationMessageFor(model => model.Direccion)
                </div>

                <div class="form_row">
                    @Html.LabelFor(model => model.Telefono, new { @class = "control-label col-md-2" })
                    @Html.EditorFor(model => model.Telefono)
                    @Html.HiddenFor(model => model.Telefono)
                    @Html.ValidationMessageFor(model => model.Telefono)
                </div>

                <div class="form_row">
                    @Html.LabelFor(model => model.Email, new { @class = "control-label col-md-2" })
                    @Html.EditorFor(model => model.Email)
                    @Html.HiddenFor(model => model.Email)
                    @Html.ValidationMessageFor(model => model.Email)
                </div>
                <br />

                <div class="form_row">

                    <input type="submit" value="Guardar" class="submit" />
                    
                </div>

            </div>
        }
        <h3>Productos del Proveedor</h3>
        <div class="form_row">
            <a class="navbutton" href=@string.Concat("/ProductoProveedor/Create/?IDPersona=", Model.IDPersona)><span class="icon_plus">Nuevo Prod.</span></a>
        </div>
        <br />
        @{Html.RenderPartial("~/Views/Shared/_ProveedorProductosList.cshtml", Model.Producto_x_Proveedor.Where(p => p.Estado == "AC"));}

        <br />
        @Html.ActionLink("Regresar al listado", "Index")
</div><!-- Block End -->
</div>


